﻿#region Using Directives

using System;

#endregion

namespace GeekRule.ORM.Entities
{
    /// <summary>
    /// Indicates how ORM data mapping should handle missing/unmappable fields
    /// </summary>
    public enum DataMappingMode
    {
        /// <summary>
        /// An exception will be thrown if data results cannot be mapped to the entity
        /// </summary>
        Strict = 1,

        /// <summary>
        /// Unmapped fields will be ignored
        /// </summary>
        IgnoreMissingFields = 2,

        /// <summary>
        /// Unmapped fields will be stored in the UnmappedFields collection
        /// </summary>
        StoreMissingFields = 3
    }

    /// <summary>
    /// Can be used to decorate entity classes to drive ORM mapping behavior.
    /// </summary>
    /// <remarks>
    /// Strict: all fields in the data result set must map to an entity property or an exception is throw.
    /// IgnoreMissingFields: fields in the data result set that cannot be mapped are ignored.
    /// StoreMissingFields: fields in the data result set that cannot be mapped are are stored in EntityBase.UnmappedFields.
    /// </remarks>
    public class DataMappingAttribute : Attribute
    {
        public DataMappingMode DataMappingMode { get; set; }
    }
}
